package com.hqyj.module.clock.dao;

import com.hqyj.module.clock.pojo.ClockTable;
import com.hqyj.module.clock.pojo.NewClockTable;
import com.hqyj.module.clock.pojo.SearchBean;
import com.hqyj.module.holiday.pojo.Holiday;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author lap
 * @version 1.0
 * @date 2021/9/29 16:31
 */
@Repository
public interface ClockDao {

    @Insert("INSERT into clock(user_id,start_time,money) VALUES(#{userId},#{startTime},#{money})")
    Integer insertClock(ClockTable clock);

    @Insert("UPDATE clock SET end_time=#{endTime},work_money = #{workMoney} \n" +
            "WHERE start_time LIKE #{likeTime} \n" +
            "and  user_id= #{userId}")
    Integer updateClock(ClockTable clock);

    @Select("SELECT * from clock where user_id=#{userId} and start_time like #{nowDay}")
    List<NewClockTable> getClock(@Param("userId") int userId, @Param("nowDay") String nowDay);

}
